<template name="orderDetail">
  {{#with order}}
  <div class="card-content" style="margin-top:-8px">
    <div class="list-block media-list" style="margin:5px 0">
      <ul>
        <li class="item-content" style="height:90px">
          <div class="item-media">
            <!-- {{#if ordertype order_type}}
            {{#each item in goods}}
            <img src="{{item.list_image.path}}" width="60px" height="60px">
            {{/each}}
            {{else}} -->
            <img src="{{merchant.list_image.path}}" width="60px" height="60px">
            <!-- {{/if}} -->
          </div>
          <div class="item-inner">
            <div class="item-title-row">
              <div class="item-title">
                <!-- {{#if ordertype order_type}}
                {{#each item in goods}}
                {{item.name}}
                {{/each}}
                {{else}} -->
                {{merchant.name}}
                <!-- {{/if}} -->
              </div>
            </div>
            <div class="item-subtitle">
              <div class="s7-detail-title-2">
                <span width="50%">
                  实付：￥{{pay_fee}}</span>
                  {{#if is_comment}}
                <a href="/orderComment?order_id={{id}}" class="external"><span class="s7-or-detail-c">评论</span></a>
                {{/if}}
                {{#if gopay state}}
<a href="/payment?order_id={{id}}&order_no={{order_no}}&mname={{merchant.name}}&pay_fee={{pay_fee}}&list_image={{merchant.list_image.path}}">
  <span class="s7-or-detail-c">去支付</span></a>
                {{/if}}
              </div>
            </div>
          </div>
        </li>
      </ul>
    </div>
  </div>
  <div class="s7-detail-title-4" style="height:110px">
    <div>
      <div class="s7-size-17"><strong>商家信息</strong></div>
      <p></p>
      <a href="/merchantDetail/{{merchant.id}}" class="external"><div><strong>{{merchant.name}}</strong></div></a>
    </div>
    <div class="s7-size-12">
      <div style="float:left">
        {{city_name}}{{merchant.address}}<br>
      </div>
      <a href="tel:{{merchant.phone}}" class="external">
        <div class="s7-m-tel">
        </div>
      </a>
    </div>
  </div>
  {{/with}}
  {{#if orderGoods}}
  <div class="list-block media-list" style="margin:5px 0">
    <ul>
      {{#each orderGoods}}
      <li class="item-content s7-list-li" style="height:90px">
          <div class="item-media" style="margin-right:5px !important">
            <img src="{{list_image.path}}" width="60px" height="60px">
          </div>
        <div class="item-inner">
          <a href="/goodsDetail/{{goods_id}}" class="external">
            <div class="item-title-row">
              <div class="item-title">
                {{goods_name}}
              </div>
            </div>
          </a>
          <div class="item-subtitle">
            <a href="/goodsDetail/{{goods_id}}" class="external">
              <div class="s7-glist-price">
                <span>售价:￥{{price}}</span>
              </div>
            </a>
          </div>
        </div>
      </li>
      {{/each}}
    </ul>
  </div>
  {{/if}}
  {{#with order}}
  <div class="s7-or-detail">
    <div>
      <div class="s7-size-17"><strong>订单信息</strong></div>
    </div>
    <p></p>
    <div class="s7-div-h s7-bottom-e">
      <span class="s7-fl">订单号</span>
      <span class="s7-fr">{{order_no}}</span>
    </div>
    <div class="s7-div-h s7-bottom-e">
      <span class="s7-fl">订单状态</span>
      <span class="s7-fr">{{orderState state}}</span>
    </div>
    {{#if ispay state}}
    <div class="s7-div-h s7-bottom-e">
      <span class="s7-fl">支付方式</span>
      <span class="s7-fr">{{paytype pay_type}}</span>
    </div>
    {{/if}}
    <div class="s7-div-h s7-bottom-e">
      <span class="s7-fl">下单时间</span>
      <span class="s7-fr">{{created_at}}</span>
    </div>
    {{#if ispay state}}
    <div class="s7-div-h s7-bottom-e">
      <span class="s7-fl">支付时间</span>
      <span class="s7-fr">{{pay_time}}</span>
    </div>
    {{/if}}
    <div class="s7-div-h s7-bottom-e">
      <span class="s7-fl">总计：</span>
      <span class="s7-fr">￥{{total_fee}}</span>
    </div>
    <div class="s7-div-h s7-bottom-e">
      <span class="s7-fl">实付：</span>
      <span class="s7-fr">￥{{pay_fee}}</span>
    </div>
  </div>
  {{/with}}
</template>
